#include "revisionentry.h"
#include <QDate>
#include <QDebug>
RevisionEntry::RevisionEntry()
{
}

RevisionEntry::RevisionEntry(int revNr, QString author, int messageSize, QString dateArg) {
    this->revNr = revNr;
    this->author = author;
    this->messageSize = messageSize;
    QString tmpDateS = dateArg;
    QDate tmpDate;
    QTime tmpTime;
    tmpTime = QTime::fromString(dateArg.left(19).right(8), "HH:mm:ss");
    tmpDate = QDate::fromString(dateArg.left(10), "yyyy-MM-dd");
    this->dateTime.setDate(tmpDate);
    this->dateTime.setTime(tmpTime);
    this->linesAdded = 0;
    this->linesRemoved = 0;
}

void RevisionEntry::setLinesAdded(int lines) {
    this->linesAdded = lines;
}

void RevisionEntry::setLinesRemoved(int lines) {
    this->linesRemoved = lines;
}

void RevisionEntry::displayInfo(void) {
    qDebug() << this->revNr << " / " << this->author << " / " << this->dateTime << " / commentSize= " << this->messageSize << " / lines+ =" << this->linesAdded << " / lines- =" << this->linesRemoved;
}
